feat(block): make furnaces smelt, burn fuel and show progress - #156
Open
xRookieFight wants to merge 2 commits into
Open
feat(block): make furnaces smelt, burn fuel and show progress#156xRookieFight wants to merge 2 commits into
xRookieFight wants to merge 2 commits into
Conversation
nepinhum
requested changes
Sep 4, 2026
|
|
||
| // furnace_can_cook reports whether the input smelts into something the output | ||
| // slot still has room for. | ||
| fn furnace_can_cook(mut tx worldrt.WorldTx, x int, y int, z int) bool { |
Member
There was a problem hiding this comment.
furnace_can_cook() doesn't receive/use the furnace variant so smoker/blast furnace appear to accept every entry in the shared smelting table.
| } | ||
|
|
||
| // light_furnace consumes one piece of fuel, if there is any. | ||
| fn light_furnace(mut tx worldrt.WorldTx, x int, y int, z int, state db.FurnaceState) db.FurnaceState { |
Member
There was a problem hiding this comment.
Consuming lava_bucket currently just removes the stack. Shouldn't this leave an empty bucket in the fuel slot?
|
|
||
| // fuel_burn_ticks is how long an item keeps a furnace lit, or none when it | ||
| // does not burn. | ||
| pub fn fuel_burn_ticks(name string) ?int { |
Member
There was a problem hiding this comment.
not every slab is burnable (stone for example)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Furnaces were a block and a recipe that produced a block nobody could use: no screen, no smelting, no fuel, no cook time.
item: ores and raw metals into ingots, food into cooked food, sand into glass, and the usual fuels from a stick to a lava bucket.worldrt.BlockEntityTicker, the same shape as the existingPlayerTicker: the world runtime owns the clock, the session decides what a tick means. Only furnaces with something to do are visited.Related issue
Part of #125
Two gaps worth naming:
ContainerSetDataPackethas no alias inprotocol.current, so the progress packet is reached through the version it was last changed in - the same workaround asMobArmorEquipmentPacketin #149. Both would be better as aliases upstream.Checklist
v -check .is cleanv test server/item/smelting_test.v,server/block/furnace_test.v,server/world/db, and the session inventory/items/blocks/runtime/registry/place/break tests are greenpub/capitalized exports, no import cycles, minimal comments)world_call/wr.submit/WorldTx), never through a global Hub actor